home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_12
/
9n12107b
< prev
next >
Wrap
Text File
|
1991-10-28
|
514b
|
21 lines
LISTING 7:
// open a file, read through it sequentially, updating each record.
{
int i;
binaryfile x(64); // file object
...
x.fileopen (filename, Update);
...
for (i = x.fileread (FirstRecord) ; i > 0 ;
i = x.fileread (NextRecord)) {
... // processing the record
x.filewrite(); // rewrite the modified record
...
}
...
} // object x goes out of scope and is
// automatically closed and destroyed